package com.xbao.controller;

import com.xbao.core.http.CommRequest;
import com.xbao.core.http.CommResult;
import com.xbao.model.req.StuAccountReq;
import com.xbao.service.GlobalService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;

/**
 * Created by qingshengzheng on 2018/12/20.
 */
@Api(value = "/global", tags = "global")
@RequestMapping(value = "global")
@Controller
@EnableAutoConfiguration
public class GlobalController extends BaseController {

    @Resource
    private GlobalService globalService;

    @ApiOperation(value = "globalConfig", notes = "globalConfig")
    @RequestMapping(value = "/globalConfig",method = RequestMethod.POST)
    @ResponseBody
    public CommResult getAccount(@RequestBody CommRequest<StuAccountReq> balanceTypeCommRequest) {
        HashMap vo= globalService.buildGlobalConfigs();
        return new CommResult<HashMap>(vo);
    }
}
